FROM golang:1.21.8 as build

WORKDIR /src/rocketmq-exporter-go

COPY . ./

RUN make

FROM alpine:3.16

WORKDIR /home/exporter/

COPY --from=build /src/rocketmq-exporter-go/bin/rocketmq_exporter_* ./rocketmq_exporter
COPY --from=build /src/rocketmq-exporter-go/config.yaml ./

EXPOSE 9999

ENTRYPOINT ["/home/exporter/rocketmq_exporter"]
